package com.ys.service.amazonorder.impl;

import com.ys.mapper.amazonorder.AmazonorderMapper;
import com.ys.service.amazonorder.TcoMonthProductJPSumService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("tcoMonthProductJPSumService")
public class TcoMonthProductJPSumServiceImpl implements TcoMonthProductJPSumService {
    private static final Logger logger = LoggerFactory.getLogger(TcoMonthProductJPSumServiceImpl.class);

    @Autowired
    private AmazonorderMapper diySqlMapper;
    @Override
    public void addBatch(String month) {
        if (month == null || month.length() != 7) {
            return;
        }

        // 删除数据
        diySqlMapper.deleteBatchTcoMonthProductJPSum(month);

        // 添加数据
        int i = diySqlMapper.insertBatchTcoMonthProductJPSum(month);
        logger.info("时间---" + month + "，添加数量---" + i);
    }
}
